<?php

class IndexController extends YouNet_Controller_Action
{
	function indexAction()
	{   
            $this->view->pages = $this->_social->getUserPages();  
            //Zend_Debug::dump($this->view->pages); 
           
            if (!Core_Util::isFacebookRequest())
            {
                // Get message from fanpage
                $isRequest = $this->_social->hasAppRequest();            
                if ($isRequest)
                {                
                    $params = $this->_social->getAppRequest();
                    $data = json_decode($params['data'],true); 
                    $data['rid'] = $params['id'];                
                    $url = $this->_social->pageUrl($data,$data['id_page']);                
                    // Ridirect to fanpage
                    YouNet_Util::parentRedirect($url);
                }
              $this->_social->redirect('/admin/index/config');
            }
	}
    function displayAction()
    {
    }
}
